package com.niiwoo.civet.mobile.util;

import org.apache.commons.lang3.StringUtils;

/**
 * @author: liaozuliang
 * @date: 2018/6/15
 */
public class MaskUtil {

    /**
     * 公司名称打码
     * @param companyName
     * @return
     */
    public static String maskCompanyName(String companyName) {
        if (StringUtils.isBlank(companyName) || companyName.length() <= 4) {
            return companyName;
        }
        return companyName.substring(0, 2) + "***" + companyName.substring(companyName.length() - 2, companyName.length());
    }
}
